home *** CD-ROM | disk | FTP | other *** search
/ Wonky Flux Batch 2019 02 / Wonky_Flux_Batch_2019-02.zip / Wonky Flux Batch 2019-02 / 093 - Land of Spur.dsk / SPUR.DUEL.S < prev    next >
Text File  |  2019-02-17  |  14KB  |  386 lines

  1.  
  2.                          ; _  _  _  _  _  _  _  _  _  _  _
  3.                          ;[_][_][_][_][_][_][_][_][_][_][_]
  4.                          ; 
  5.                          ;       The Land of SPUR
  6.                          ;       (C)opyright 1987
  7.                          ;         Greg W. Davis
  8.                          ;             and
  9.                          ;       Peripherals Plus
  10.                          ;
  11.                          ; 03/09/87                18:56
  12.                          ;--------------------------------
  13.                          ;          Spur.duel
  14.                          ;   Adventurer Challenge Segment
  15.                          ; _  _  _  _  _  _  _  _  _  _  _
  16.                          ;[_][_][_][_][_][_][_][_][_][_][_]
  17.           
  18.           public duel
  19.           
  20.           on nocar goto dropped
  21.           hh=0:b=0:wr$="":cw$="":sx=0
  22.           if (sl=cl) and (sr=cr) goto chalspur
  23.           goto challenge
  24.           
  25. duel
  26.           on nocar goto dropped
  27.           if bd gosub scn.dsp
  28.           print \"Return="dc$  
  29.           print \"["hp   ;:input @2 "] (D)uel  (F)lee  (R)eady  (S)tats: "i$
  30.           if i$="" then i$=left$(dc$,1) 
  31.           if i$="D" then dc$="DUEL":goto attack
  32.           if i$="F" then dc$="FLEE":goto flee
  33.           if i$="S" then dc$="STATS":dy$=dz$+"spur.sub":link dy$,"show4"
  34.           if i$="R" then dc$="READY":gosub rdy.wp:goto duel
  35.           goto duel
  36.           
  37.           
  38.                          ; ***********************************
  39.                          ; *  List Adventurers in same Room  *
  40.                          ; ***********************************
  41.           
  42. challenge
  43.           print \"Adventurers in current room:"\
  44.           dy$=dx$+"spur.users"
  45.           ch=0:x=1:open #1,dy$
  46. chlng1
  47.           if x=pn x=x+1
  48.           position #1,130,x
  49.           input #1,n2$,ys,yp,yl,yr,yh
  50.           if (yl=cl) and (yr=cr) then ch=1:print "Adventurer #"x" Name: "n2$
  51.           x=x+1:if x>np close: goto chlng2
  52.           goto chlng1
  53.           
  54.                          ; ***********************
  55.                          ; *  Choose Adventurer  *
  56.                          ; ***********************
  57.           
  58. chlng2
  59.           if not ch print \"No other Adventurers in this room!"\:goto linkgame
  60.           input @2\"Challenge which Adventurer (CR=Abort) ? "i$:if i$="" goto linkgame
  61.           x=val(i$):if (x<1) or (x>np) print \"No such Adventurer!":goto chlng2
  62.           if x=pn print \"You CANNOT Challenge yourself!":goto chlng2
  63.           au=0
  64.           open #1,dy$:position #1,130,x
  65.           input #1,n2$,ys,yp,yl,yr,yh
  66.           input #1,cs,ct,ci,ce,cw,cd
  67.           input #1,ya,yb,yc,yd,ye,yf,p1$
  68.           input #1,p2$:close
  69.           if (cl<>yl) or (cr<>yr) print \"That Adventurer is NOT here!":goto chlng2
  70.           gosub opnt.wp:if hh gosub hndtohnd
  71.           
  72.           print \n2$" says: 'I accept your Challenge!'"
  73.           if not hh print \"I choose "cw$
  74.           input @0\"Do you wish to battle to the death? "i$
  75.           if i$="Y" then b=1
  76.           h=yh
  77.           if not hh gosub rdy.wp
  78.           dc$="DUEL":goto duel
  79.           
  80.                          ; ******************
  81.                          ; *  Hand to Hand  *
  82.                          ; ******************
  83.           
  84. hndtohnd
  85.           print \n2$" says: '
  86. I         fear you not, and would gladly do
  87. battle    with you, but as you see, I
  88. have      no weapons!'
  89.           input @0\"Wilst Thou fight me hand to hand? "i$:if i$<>"Y" pop:goto linkgame
  90.           wr$="FISTS":cw$="FISTS":gosub set.hh:wd=p1:w4=p2:ws=p3:w3=p4
  91.           return
  92.           
  93.                          ; ******************************
  94.                          ; *  Challenger Choose Weapon  *
  95.                          ; ******************************
  96.           
  97. rdy.wp
  98.           if hh print \"Thou art a Cheat and a COWARD!":pop:hp=hp-1:goto attack1
  99.           if ps<3 print \"Not enough strength to ready a weapon!":return
  100.           if xw=0 print \"You have No Weapons!":return
  101.           print \"Choose a Weapon:"\
  102.           dy$=dx$+"weapons"
  103.           open #1,dy$
  104.           for e=1 to xw
  105.           y=(e*4)-3:a=val(mid$(xw$,y))
  106.           position #1,34,a,2
  107.           input #1,w$
  108.           print e". "mid$(w$,3)
  109.           next
  110. rdy.wp1
  111.           input \"Weapon number you choose ? "x
  112.           if (x<1) or (x>xw) print \"You don't have that weapon!":goto rdy.wp1
  113.           y=(x*4)-3:a=val(mid$(xw$,y))
  114.           position #1,34,a,2
  115.           input #1,wr$\ws,wd
  116.           wr$=mid$(wr$,3):print \wr$" readied!"
  117.           gosub set.hh
  118.           wd=wd*5/10:x=p1*7/10:wd=wd+x
  119.           ws=(ws+p3)/2
  120.           close:return
  121.           
  122.                          ; *******************************
  123.                          ; *  Get Opponents Best Weapon  *
  124.                          ; *******************************
  125.           
  126. opnt.wp
  127.           dy$=dx$+"weapons":dw$=dx$+"spur.weapons"
  128.           open #1,dy$:open #2,dw$
  129.           position #2,64,yp
  130.           input #2,c\i$:if c=0 print \n2$" has no Weapons!":close:hh=1:return
  131.           w4=0:for e=1 to c
  132.           y=(e*4)-3:a=val(mid$(i$,y))
  133.           position #1,34,a,2
  134.           input #1,w$\w1,w2
  135.           if w2>w4 then w3=w1:w4=w2:cw$=w$
  136.           next:close:cw$=mid$(cw$,3)
  137.           gosub set.hh
  138.           w4=w4*5/10:x=p2*7/10:w4=w4+x
  139.           w3=(w3+p4)/2
  140.           return
  141.           
  142.                          ; ********************
  143.                          ; *  Challenge SPUR  *
  144.                          ; ********************
  145.           
  146. chalspur
  147.           x=pe+pi+ps+pw+pt+pd
  148.           if x<90 print \'
  149. "Thou     art too weak to challenge
  150. the       omnipotent Spur!"':goto linkflee
  151.           
  152.           print \'
  153. SPUR      asks "Doest thou dare
  154. challenge me?" '         ;:input @0 i$
  155.           if i$<>"Y" print \"Return when thy courage is greater!":goto linkflee
  156.           cs=20:ct=20:ci=20:ce=20:cw=20:cd=20
  157.           h=10*s1:h=h+random(10):if h>51 then h=51
  158.           a=x1*3:if a<h then h=h-a
  159.           ya=0:yb=5000:sx=1:zz$=rnd$:ye=50:yf=50:n2$="The Omnipotent SPUR":dc$="DUEL"
  160.           
  161.           dy$=dx$+"weapons"
  162.           open #1,dy$
  163.           w4=0:for e=1 to wc
  164.           position #1,34,e,2
  165.           input #1,w$\w1,w2
  166.           if w2>w4 then w3=w1:w4=w2:cw$=w$
  167.           next:close:cw$=mid$(cw$,3)
  168.           gosub set.hh
  169.           w4=w4*5/10:x=p2*7/10:w4=w4+x
  170.           w3=(w3+p4)/2
  171.           gosub rdy.wp:goto duel
  172.           
  173.                          ; *************************
  174.                          ; *  YOU Attack Opponent  *
  175.                          ; *************************
  176.           
  177. attack
  178.           if (not au) and (sd=1) gosub at.tune
  179.           if wr$="" goto attack1
  180.           gosub get.numb
  181.           if a>4 goto attack1
  182.           zz$=rnd$:w1=random(wd):if w1=0 then w1=1
  183.           gosub get.numb
  184.           print \"You Attack "n2$"!!";:if ws>a print" Hit!":else print" Miss!":goto duel
  185.           if ye print "Shield takes Hit!":ye=ye-1:w1=w1-1
  186.           if w1<=0 goto duel
  187.           if yf print "Armor takes Hit!":yf=yf-2:w1=w1-2
  188.           if yf<0 then yf=0
  189.           if w1<=0 goto duel
  190.           print n2$" Hit! Takes "w1" damage!":h=h-w1
  191.           if h<=0 then ch=1:goto hell
  192.           goto duel
  193.           
  194.                          ; **************************
  195.                          ; *  OPPONENT Attacks You  *
  196.                          ; **************************
  197.           
  198. attack1
  199.           if hp<=0 then ch=0:goto hell2
  200.           zz$=rnd$:w1=random(w4):if w1=0 then w1=1
  201.           gosub get.numb
  202.           print \n2$" Attacks with "cw$"!!":if w3>a print "Hit!":else print "Miss!":goto duel
  203.           if sh print "Shield takes Hit!":sh=sh-1:w1=w1-1
  204.           if w1<=0 goto duel
  205.           if ar print "Armor takes Hit!":ar=ar-2:w1=w1-2
  206.           if ar<0 then ar=0
  207.           if w1<=0 goto duel
  208.           print n1$" Hit! Takes "w1" damage!":hp=hp-w1:ps=ps-1
  209.           if hp<=0 then ch=0:goto hell2
  210.           if ps<3 then wr$="":print\'
  211. Thy       strength is fading...  Unable to
  212. defend    thyself!!'
  213.           goto duel
  214.           
  215. flee
  216.           if b print \"Thy choice has been made!":goto duel
  217.           gosub get.numb:a=(a*10):if (a+pi+pw+pe)>90 goto flee2
  218.           print \n2$' blocks your path! 
  219. "Stand    and fight you COWARD!!"'
  220.           goto attack1
  221. flee2
  222.           print \n2$' cries:
  223. "Run      you COWARD!!! I will catch you
  224. at        a later date!"'
  225.           print \"In your haste to escape you have dropped all your weapons!"
  226.           gosub strip.wp
  227.           goto linkflee
  228.           
  229.                          ; ****************************************
  230.                          ; *  Winner declared and Gold Exchanged  *
  231.                          ; ****************************************
  232.           
  233. hell
  234.           if (b) or (sx) print \"You have killed "n2$" !!!!":else print \"You have vanquished "n2$" !!!!"
  235.           yb=yb+1000:if b=1 then yb=yb+1000
  236.           if yb=>10000 then ya=ya+1:yb=yb-10000
  237.           g1=ya:g2=yb:gosub prt.gold:print "You are now $"gd$" in gold richer!":gh=gh+ya:gl=gl+yb:ya=0:yb=0
  238.           if gl=>10000 then gl=gl-10000:gh=gh+1
  239.           yl=1:yr=0
  240.           if (sx) then sr=0:goto linkgame
  241.           goto wr.stat
  242.  
  243. hell2
  244.           if b print \"You have been killed by "n2$" !":else print \"You have been vanquished by "n2$" !":hp=3
  245.           gl=gl+1000:if b=1 then gl=gl+1000
  246.           if gl=>10000 then gh=gh+1:gl=gl-10000
  247.           ya=ya+gh:yb=yb+gl:if yb=>10000 then yb=yb-10000:ya=ya+1
  248.           g1=gh:g2=gl:gh=0:gl=0:gosub prt.gold:if b goto wr.stat
  249.           print 'As is his right, he has stripped you of
  250. all       your weapons, gold and belongings!'
  251.  
  252. strip
  253.           gosub strip.it:xf=0:xf$="":wr$="":ws=0:wd=0
  254.           if (a1) or (a2) or (a3) print \"Your Allies have abandoned you!":a1=0:a2=0:a3=0:d1$="*":d2$="*":d3$="*"
  255.           ps=ps/2:pw=pw/2:pe=pe/2
  256.  
  257. wr.stat
  258.           if (sx) goto linkflee
  259.           dy$=dx$+"spur.users"
  260.           open #1,dy$:position #1,130,yp
  261.           print #1,n2$,ys,yp,yl,yr,yh
  262.           print #1,cs,ct,ci,ce,cw,cd
  263.           print #1,ya,yb,yc,yd,ye,yf,p1$
  264.           print #1,p2$
  265.           close
  266.           
  267.                          ; *****************************
  268.                          ; *  Send E-Mail to Opponent  *
  269.                          ; *****************************
  270.           
  271. sendmail
  272.           dy$=dm$+"mail":ready dy$:edit(0)
  273.           if info(6)<29 goto endduel
  274.           print #msg(ys),sn:print #6," ** Results from a Challenge in SPUR **"
  275.           print #6,\" Date -> "date$" "time$\
  276.           if ch then print #6,"You were defeated by "n1$:else print #6,"You were victorious over "n1$
  277.           print #6,"in a Duel in the "lo$
  278.           if ch then print #6,n1$" was awarded "gd$" gold!":else print #6,"You won "gd$" gold!"
  279.           if ch then print#6, \"You were stripped of all your gold!"
  280.           copy #8,#6
  281.           print #msg(ys),chr$(4);chr$(0);
  282.           msg(ys)=1:update
  283.           dp=1:print \"Your Opponent has been notified!"\
  284.           
  285. endduel
  286.           if (b=1) and (ch=0) goto linkdead:else goto linkgame
  287.           
  288. strip.it
  289.           xi=0:xi$="":xm=0:xm$=""
  290.           
  291. fre.ally
  292.           if d1$<>"*" x=h1:gosub free2
  293.           if d2$<>"*" x=h2:gosub free2
  294.           if d3$<>"*" x=h3:gosub free2
  295.           goto strip.wp
  296. free2
  297.           if x<=0 return
  298.           dy$=dx$+"allies":open #1,dy$
  299.           position #1,26,x
  300.           print #1,1:close:return
  301.  
  302. strip.wp
  303.           dy$=dx$+"weapons"
  304.           open #1,dy$
  305.           if xw=0 close:return
  306.           for x=1 to xw
  307.           y=(x*4)-3:a=val(mid$(xw$,y))
  308.           cb$="2":if a>10 then cb$="1"
  309.           position #1,34,a
  310.           print #1,cb$
  311.           next:close
  312.           xw=0:xw$="":return
  313.           
  314. at.tune
  315.           pl$="134,100,81,67,67,67,67,81,81,81,81,100,81,100,134"
  316.           du$="70,70,90,40,20,20,60,40,20,20,60,70,80,80,180"
  317.           au=1:goto tune
  318.           
  319. tune
  320.           p=val(pl$):du=val(du$)
  321.           tone(p,du)
  322.           a=instr(",",pl$):if a=0 return
  323.           pl$=mid$(pl$,a+1)
  324.           a=instr(",",du$):if a=0 return
  325.           du$=mid$(du$,a+1)
  326.           goto tune
  327.           
  328. prt.gold
  329.           a$=str$(g1):gd$="0000":if g1=0 then gd$="    ":a$=" "
  330.           gd$=right$("    "+a$,5)+right$(gd$+str$(g2),4)
  331.           return
  332.  
  333. get.numb
  334.           zz$=rnd$:zz$=rnd$:a=random(100) mod 10
  335.           return
  336.  
  337.                          ; ***********************************
  338.                          ; *  Set attribute related factors  *
  339.                          ; ***********************************
  340.           
  341. set.hh
  342.           p1=ps+pd+pt+pe:p1=p1/10
  343.           p2=cs+cd+ct+ce:p2=p2/8
  344.           if p1>9 then a=p1-9:p1=9:p2=p2-a
  345.           if p2>9 then a=p2-9:p2=9:p1=p1-a
  346.           if p1<3 then p1=3
  347.           if p2<3 then p2=3
  348.           
  349.           p3=pw+pi:p3=p3/4
  350.           p4=cw+ci:p4=p4/4
  351.           if p3>9 then a=p3-9:p3=9:p4=p4-a
  352.           if p4>9 then a=p4-9:p4=9:p3=p3-a
  353.           if p3<5 then p3=5
  354.           if p4<5 then p4=5
  355.           return
  356.           
  357. scn.dsp
  358.           print #3 @21,23 right$("   "+str$(ps),3)
  359.           if peek(33)=40 goto scn.rtn
  360.           print #3 @63,23 right$("  "+str$(ar),3)
  361.           print #3 @70,23 right$("  "+str$(sh),3)
  362. scn.rtn
  363.           print #3 @1,20
  364.           return
  365.           
  366. linkgame
  367.           wr$=""
  368.           dy$=dz$+"spur.main"
  369.           ready dr$:link dy$,"travel3"
  370.           
  371. linkdead
  372.           wr$="":if hp<0 then xn=sn:sn=0
  373.           dy$=dz$+"spur.main"
  374.           dp=0:link dy$,"dueldead"
  375.           
  376. linkflee
  377.           wr$=""
  378.           dy$=dz$+"spur.main"
  379.           ready dr$
  380.           link dy$,"flee2"
  381.  
  382. dropped
  383.           if (b) or (hp<=0) then sn=0:dy$=dz$+"spur.main":link dy$,"dropdead"
  384.           dy$=dz$+"spur.logon"
  385.           link dy$,"quit3"
  386.